﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.IO;
using FieldDevice;

namespace FieldDevice.UI
{
    public partial class MeterControl : UserControl
    {
        public MeterControl()
        {
            InitializeComponent();
        }

        private const int maxNumber = 1000;

   //     private int countNumber = 0;
        //存储电压数据
       public ArrayList VoltageList= new ArrayList();

        //存取电流数据
     //  private float[] currentList;

        //存取电功率数据
   ///     private ArrayList powerList;
   ///     
        
        Device _dev;

     
       public Device Device
       {
           get { return _dev; }
           set
           {
               this._dev = value;
               if (this._dev != null)
                   this._dev.ReadChangeEvent += new Device.ReadChangeEventHander(_dev_ReadChangeEvent);
           }
       }

       public delegate void VoidDelegate();
       VoidDelegate UpdateReadsDelegate;

       void _dev_ReadChangeEvent(Device device, string name, float value)
       {
           if (this.InvokeRequired)
           {
               this.Invoke(this.UpdateReadsDelegate);
           }
       }

       public void SetUnits(string VoltageUnit,string CurrentUnit,string PowerUnit)
       {
       }


    }
}
